package com.briup.day12;

public class Test_Annoymous {
    public static void main(String[] args) {
        class ISleepImp implements ISleep {
            public void sleep() {
                System.out.println("躺着睡");
            }
        }
        ISleepImp is=new ISleepImp();
        is.sleep();
        System.out.println("----------------------");
        ISleep is1=new ISleep(){
            @Override
            public void sleep() {
                System.out.println("趴着睡");
            }
        };
        is1.sleep();
        System.out.println("----------------------");
        //简化版格式
        new ISleep(){
            public void sleep() {
                System.out.println("站着睡");
            }
        }.sleep();
    }
}
interface ISleep {
    void sleep();
}
